@extends('layouts.app')
@section('style')
<link rel="stylesheet" href="{{ asset('radio/css/jquery-labelauty.css') }}">
<style>
/*ul { list-style-type: none;}
li { display: inline-block;}
li { margin: 10px 0;}*/
input.labelauty + label { font: 12px "Microsoft Yahei";}
</style>
@endsection
@section('content')
<div class="container">
    <div class="row">
        <div class="col-md-8 col-md-offset-2">
            <div class="panel panel-default">
                <div class="panel-heading">充值</div>
                <div class="panel-body">
                    <form class="form-horizontal" role="form" method="POST" action="{{ url('smpay') }}">
                        {!! csrf_field() !!}

                        <div class="form-group{{ $errors->has('name') ? ' has-error' : '' }}">
                            <label class="col-md-4 col-xs-4 text-right">用户:</label>
                            <label class="col-md-6 col-xs-8 ">{{ $user->name }}</label> 
                        </div>

                        <div class="form-group{{ $errors->has('balance') ? ' has-error' : '' }}">
                            <label class="col-md-4 col-xs-4 text-right">余额:</label>
                            <label class="col-md-6 col-xs-8">{{ $user->balance }} </label> 
                        </div>
						<div class="form-group{{ $errors->has('money') ? ' has-error' : '' }}" style="line-height: 34px;">
                            <label class="add-on  col-md-4 col-xs-4 text-right">充值金额:</label>

                            <div class="col-md-6 col-xs-8">
                                <input type="text" class="form-control" name="money" placeholder="请输入充值金额">
                            </div>
                                @if ($errors->has('money'))
                                    <span class="help-block">
                                        <strong>{{ $errors->first('money') }}</strong>
                                    </span>
                                @endif
                        </div>
                        
                        <div class="form-group">
                            <label class="col-md-4  control-label col-xs-4 text-right" style="height: 36px;">充值方式:</label>
                           
                            <!-- <div class="col-md-12"> -->
                                <ul style="list-style-type: none;" class="dowebok col-md-6 col-xs-12">
                                <!-- <li style="display: inline-block;"><input type="radio" name="rechargetype" value="wx"  data-labelauty="微信充值"></li> -->
                                <li style="display: inline-block;"><input type="radio" name="rechargetype" value="sm" checked data-labelauty="扫码充值"></li>
                                <!-- <li><input type="radio" name="rechargetype" value="yl" data-labelauty="银联充值"></li> -->
                                
                            </ul>
                            <!-- </div> -->
                            
                        </div>
                        <div class="form-group">
							<div class="col-md-6 col-md-offset-4">
                                <!-- <button type="button" onclick="submitYouFrom();" class="btn btn-primary btn-lg btn-block"> 充值</button> -->
                                <input type="submit"  class="btn btn-primary btn-lg btn-block"> 充值</input>
                            </div>                            
                        </div>
                        <div class="form-group">
                            <div class="col-md-6 col-md-offset-4">
                                <div class="checkbox">
                                    <label>
                                        <i class="fa glyphicon glyphicon-hand-right public-marginright10"></i>每笔最少10元，最多5000元。
                                    </label>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
@endsection
@section('js')
<!-- <script src="{{ asset('radio/js/jquery-1.8.3.min.js') }}"></script> -->
<script src="{{ asset('radio/js/jquery-labelauty.js') }}"></script>
<script>
$(function(){
    $(':input').labelauty();
});
</script>
<script type="text/javascript" language="javascript">
function submitYouFrom(){
 //var type = $('input[name="rechargetype"][checked]');
 var type = $('input:radio:checked').val();
 if(type=='wx'){
    var path="{{ url('weixinpay') }}";
 }
 if(type=='sm'){
    var path="{{ url('smpay') }}";
 }

 if(type=='yl'){
    var path="{{ url('ylpay') }}";
 }
 //var path="{{ url('smpay') }}";
 //alert(type);
 //alert(path);
 //$('form').action=path;
 $("form").attr("action", path);
 $('form').submit();
}
</script>
@endsection